using APITransLib.Contracts;

namespace ChatWithMulitAIServer.Data;

public interface IChatRepository
{
    // Users
    Task<UserDto> CreateUserAsync(string displayName, CancellationToken ct = default);
    Task<UserDto?> GetUserAsync(string id, CancellationToken ct = default);

    // Groups
    Task<GroupDto> CreateGroupAsync(string name, IEnumerable<string> memberIds, CancellationToken ct = default);
    Task<GroupDto?> GetGroupAsync(string id, CancellationToken ct = default);
    Task AddUsersToGroupAsync(string groupId, IEnumerable<string> userIds, CancellationToken ct = default);

    // Messages
    Task<MessageDto> AddMessageAsync(string fromUserId, string? toUserId, string? toGroupId, MessageKind kind, string content, CancellationToken ct = default);
    Task<IReadOnlyList<MessageDto>> GetMessagesForUserAsync(string userId, int skip, int take, CancellationToken ct = default);
    Task<IReadOnlyList<MessageDto>> GetMessagesForGroupAsync(string groupId, int skip, int take, CancellationToken ct = default);
}
